/*
 * task_server.h
 *
 *  Created on: 2011. 2. 20
 *      Author: pts
 */

#ifndef TASK_SERVER_H_
#define TASK_SERVER_H_

#include "msg.h"

enum enu_task_server_Download {dns_nothing=0, dns_req, dns_data,dns_data_complete };

#define M_UDP_TASK_CALL_FREQ	50
#define M_UDP_TASK_TIME_OUT		30
#define M_UDP_TASK_TIME_ELAPSED	5
#define M_UDP_TASK_MAX_RETRY_CNT	3

#define MAX_FW_FILE_SIZE 2000000

typedef struct
{
	int Step;
	int Status; //0:try, 1:ok, -1:fail
	int iTry;	//
	int iElapsed;

	int iElapsedCnt;
	int iSubElapsed;
	int iSubElapsedCnt;
	int bResult;


} _st_server_download;


typedef struct
{
	int first;
	char *p;
	int blocksize;
	int totalBlock;
	int currentBlock;

	int mod;
	int filepos;
	int size_sent;
	int filesize;
	int good;
}_st_Download_File;

int task_server_Download();
extern _st_Download_File stDF;
extern _st_server_download DLs;
int task_server_Download();

//void dl_printf(char *fmt,...);
#define udp_printf(...)							\
{												\
	if(debug_out_udp){							\
		printf(__VA_ARGS__);					\
	}											\
}


#endif /* TASK_SERVER_H_ */
